{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "cb9e3f4a",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "[[ 1.33811605e+00 -8.96026194e-01  1.46236801e+00 -1.03798378e+00\n",
      "  -4.67702121e-01  1.11522114e+00 -3.64413261e-01 -5.74876785e-01\n",
      "   5.03844380e-01 -3.59023362e-02  2.18777680e+00  1.95698047e+00\n",
      "   5.47037609e-02  1.27065742e+00  6.64740950e-02  7.41537035e-01\n",
      "   1.93526283e-01  2.91082978e-01  7.98296154e-01 -3.04611772e-01\n",
      "  -2.09055614e+00  9.34948087e-01 -8.09577703e-01 -4.15380672e-02\n",
      "  -4.72813785e-01  3.65376770e-02 -2.45516539e+00 -2.53662944e+00\n",
      "   6.88973814e-03  5.00616193e-01 -2.26373207e-02 -2.04420424e+00\n",
      "  -1.29647779e+00 -1.96764410e-01 -5.77632725e-01  1.02273333e+00\n",
      "  -3.47855568e-01  8.46977085e-02  1.72047019e+00  5.99860489e-01\n",
      "   4.69706655e-01 -1.79441762e+00 -2.28501424e-01  1.20429456e+00\n",
      "   4.37735200e-01  1.88857520e+00  2.82273233e-01  5.13661325e-01\n",
      "   1.62379861e+00 -1.83038878e+00 -1.54809129e+00  7.15435594e-02\n",
      "  -2.50557876e+00 -4.98595715e-01 -2.89687634e-01 -1.28814742e-01\n",
      "  -4.94300276e-01  6.75048351e-01 -4.16781098e-01 -1.18798859e-01\n",
      "  -9.57638085e-01 -8.33338350e-02 -4.63504732e-01 -6.34233594e-01\n",
      "  -1.70661438e+00 -1.83536136e+00  6.17667884e-02 -4.90929112e-02\n",
      "  -2.30917454e-01  1.10030258e+00 -9.90888655e-01 -1.54544353e+00\n",
      "   1.39462149e+00  1.05075443e+00  3.67180735e-01 -6.24037236e-02\n",
      "  -4.99443978e-01  1.65967679e+00  7.39778519e-01  4.49273437e-01\n",
      "  -3.27372886e-02 -1.05685544e+00  8.56589079e-01 -6.65892899e-01\n",
      "  -1.20305680e-01  6.89403296e-01 -8.39475513e-01 -1.87757984e-02\n",
      "  -1.61830437e+00 -2.02687368e-01  6.21256888e-01  1.13373482e+00\n",
      "   1.59070328e-01 -1.48646310e-01 -4.68492508e-01  1.29547626e-01\n",
      "   2.10434869e-01 -1.34549713e+00 -1.52527705e-01  1.54425335e+00\n",
      "  -1.28108168e+00 -5.44109881e-01 -1.09092556e-01  2.01068306e+00\n",
      "  -6.19897723e-01 -8.17371830e-02  7.03093231e-01 -1.15154660e+00\n",
      "  -9.22570765e-01 -3.73409718e-01 -2.71287728e-02 -7.65027106e-01\n",
      "   1.75392270e-01  4.95242387e-01 -3.92061949e-01  1.11218192e-01\n",
      "  -6.51952401e-02 -1.49187949e-02 -7.70718530e-02 -4.91638064e-01\n",
      "   2.09131169e+00  6.06603682e-01  1.08715102e-01  1.78671396e+00\n",
      "   2.47560573e+00  8.28674734e-02 -7.28066623e-01 -1.26622662e-01\n",
      "   3.56554180e-01 -2.03264976e+00  7.98581779e-01  9.37225223e-02\n",
      "  -1.00437629e+00 -1.24017084e+00 -2.58309811e-01 -4.18020606e-01\n",
      "   1.84432253e-01  2.27083832e-01 -1.56559929e-01  6.14570081e-01\n",
      "   1.09431469e+00  5.33215344e-01 -6.60355031e-01 -4.05035853e-01\n",
      "   1.52076304e+00  9.72001433e-01  7.32573748e-01  7.28142917e-01\n",
      "  -3.29003781e-01  1.12900853e-01  5.41530073e-01 -1.76034796e+00\n",
      "   3.33346575e-01  1.79195058e+00 -1.67720509e+00 -1.74734998e+00\n",
      "  -4.28181022e-01  6.47516772e-02  6.63928807e-01  2.09330225e+00\n",
      "  -1.56685042e+00 -1.59830606e+00 -4.23107386e-01  1.17180216e+00\n",
      "   4.71751332e-01  9.19503421e-02  1.48835433e+00 -1.04587269e+00\n",
      "   1.82691264e+00  2.99742501e-02 -1.39706329e-01  1.06751001e+00\n",
      "   8.34120691e-01 -3.43312234e-01  1.46847665e-01 -2.19280943e-02\n",
      "  -3.31610888e-01 -5.85178792e-01  1.60434484e+00 -2.05569655e-01\n",
      "  -3.01064253e-01  8.29169825e-02  3.34356278e-01 -2.08423114e+00\n",
      "  -7.20589817e-01 -1.09135520e+00 -7.69785881e-01  2.54814535e-01\n",
      "   1.90540075e+00  7.24621892e-01 -2.56530344e-01  1.92457996e-02\n",
      "   8.22202444e-01  1.84412539e-01  1.58604765e+00 -1.50391817e-01\n",
      "  -5.66071093e-01 -9.89907146e-01 -3.77718627e-01  1.12708485e+00]\n",
      " [ 6.32971466e-01 -1.04137862e+00 -6.55750036e-01 -5.64837933e-01\n",
      "  -1.08997750e+00 -5.20298421e-01 -7.04704583e-01  9.12205875e-01\n",
      "   8.54813695e-01  6.34513795e-01 -1.30875635e+00 -2.74934441e-01\n",
      "   8.34466338e-01 -4.00655031e-01 -4.42386508e-01  1.26740074e+00\n",
      "  -9.98296618e-01  1.00092947e-01  8.48308504e-01  4.60160792e-01\n",
      "  -1.53356344e-01  6.38427198e-01  1.22967732e+00  8.34091246e-01\n",
      "  -7.32828259e-01  4.91018265e-01 -6.77517727e-02 -6.03648841e-01\n",
      "  -8.47030997e-01  5.47673583e-01 -8.55251253e-01 -1.29669905e-01\n",
      "   1.15995295e-01  1.70167160e+00  1.39065862e+00 -1.85452923e-01\n",
      "  -9.75630283e-01 -2.66686548e-02  1.24000525e+00  8.33072007e-01\n",
      "  -8.89601827e-01 -2.74288106e+00 -1.32229185e+00 -9.48984742e-01\n",
      "  -8.31518888e-01 -9.64644015e-01 -2.14171147e+00 -1.11394966e+00\n",
      "   7.35252440e-01 -1.29446626e+00  1.36648309e+00 -1.38621137e-01\n",
      "   3.66343528e-01  3.31059307e-01 -1.57546550e-01  6.03016675e-01\n",
      "  -4.68161702e-01 -1.40725851e+00 -7.63709664e-01  2.23251045e-01\n",
      "  -1.17845571e+00 -9.72943157e-02  5.67670047e-01  2.59756732e+00\n",
      "  -2.05276012e-01 -7.76123881e-01 -7.85119176e-01 -1.39717329e+00\n",
      "   1.06813121e+00 -7.07378864e-01 -6.53306901e-01 -1.82323679e-01\n",
      "  -8.67707849e-01  1.31762934e+00  1.32584167e+00 -2.89274037e-01\n",
      "   2.03580841e-01  1.00213206e+00  1.22655225e+00  1.29750323e+00\n",
      "   4.76377666e-01  7.17253566e-01 -3.11406791e-01 -6.35963559e-01\n",
      "   1.96751237e+00  6.62701547e-01 -4.71891493e-01  7.20732585e-02\n",
      "   6.58548355e-01  1.19249797e+00  6.91461205e-01 -4.11425442e-01\n",
      "  -3.64830792e-01 -2.24902892e+00 -5.10560811e-01  8.00081491e-01\n",
      "   6.64412022e-01  8.34721029e-02 -3.15900296e-01  4.85035079e-03\n",
      "  -1.50708330e+00  4.71765429e-01  1.27061641e+00 -2.69609779e-01\n",
      "   5.48033640e-02  5.46446741e-01  1.37137175e+00 -1.82480133e+00\n",
      "  -1.15929119e-01 -1.60586476e+00 -2.24920386e-03 -5.86000085e-01\n",
      "   2.37577613e-02  2.32351199e-03  4.38500643e-02  7.60884464e-01\n",
      "   4.37989920e-01  2.93067783e-01 -1.97485104e-01 -7.85414815e-01\n",
      "  -1.96989134e-01 -3.05720538e-01 -2.62314118e-02 -6.10404193e-01\n",
      "   2.40931123e-01 -7.99692988e-01 -6.10285044e-01 -1.15543509e+00\n",
      "   1.58729210e-01  8.33517253e-01 -5.55828273e-01 -2.05698442e+00\n",
      "  -1.34319770e+00  6.31124377e-01  1.30692661e-01 -1.88294637e+00\n",
      "   1.61650732e-01  8.05883944e-01 -2.01864075e-02 -2.80421466e-01\n",
      "   8.56147349e-01  6.61465824e-01 -9.70459640e-01  1.57461441e+00\n",
      "   9.83645439e-01 -1.04953885e+00 -4.28867012e-01  2.33239513e-02\n",
      "  -5.77595830e-01 -9.50846374e-02  3.49726439e-01  7.50294030e-01\n",
      "  -3.46238256e-01 -1.02724731e+00 -1.47279704e+00 -1.92997277e-01\n",
      "   1.44633341e+00 -2.31823182e+00 -6.17368817e-01  4.56855923e-01\n",
      "   1.94628358e-01  6.93105698e-01 -4.36038554e-01  5.19334674e-01\n",
      "  -9.69941080e-01  8.14110279e-01 -1.25484920e+00  2.82960683e-01\n",
      "  -9.52232853e-02  9.67460096e-01 -3.56448919e-01  7.84572124e-01\n",
      "   7.43804038e-01 -5.47006249e-01 -4.19586226e-02 -4.60628629e-01\n",
      "   9.74575162e-01 -2.00078082e+00  1.07659101e+00  1.08890975e+00\n",
      "  -9.91924822e-01  5.45071997e-02 -5.19857526e-01 -1.84507656e+00\n",
      "   2.66654432e-01 -7.48697966e-02  8.11280549e-01 -2.21989131e+00\n",
      "  -5.60618080e-02  6.54388517e-02 -1.73994482e+00 -7.68018901e-01\n",
      "   4.84875776e-03  7.65136302e-01  9.94544446e-01 -1.74686301e+00\n",
      "  -1.32063341e+00 -4.13648695e-01  1.23532724e+00 -2.79786885e-01]\n",
      " [-2.45824432e+00 -5.36458850e-01  4.73137140e-01 -8.17404151e-01\n",
      "   2.07326282e-02  1.21883154e+00  1.57456324e-02 -1.26300097e-01\n",
      "   2.14084193e-01 -2.23214820e-01  1.43059269e-01  4.93037909e-01\n",
      "   1.30708945e+00 -6.66714907e-01  1.35214317e+00 -1.03355676e-01\n",
      "  -5.64190269e-01 -1.83032072e+00 -9.51376379e-01  2.75463521e-01\n",
      "   5.55697620e-01  3.49778867e+00  7.10726202e-01  1.56553850e-01\n",
      "  -1.89077365e+00 -7.53588155e-02 -1.03475249e+00 -5.44671774e-01\n",
      "   7.44186401e-01  8.80581439e-01 -1.33311653e+00  5.78163326e-01\n",
      "  -1.33788514e+00 -3.94320115e-02 -1.62609577e-01  5.16894400e-01\n",
      "  -3.93431425e-01  1.65880013e+00  6.49356365e-01  1.53825849e-01\n",
      "   8.89261425e-01  9.21563923e-01  7.71894217e-01 -3.59355509e-01\n",
      "  -7.50579000e-01 -7.79200912e-01 -7.54909456e-01 -8.76043141e-01\n",
      "  -1.12421215e-01 -9.09375846e-01 -3.66159976e-01  2.03644678e-01\n",
      "  -6.08195007e-01  1.25693095e+00  5.53462088e-01  3.00875574e-01\n",
      "   1.51525748e+00 -4.98767346e-01 -3.37717921e-01  5.40740311e-01\n",
      "  -4.26469654e-01  2.37710643e+00  5.23647130e-01 -1.18838206e-01\n",
      "   4.10783380e-01 -1.89385808e+00 -8.33773553e-01 -9.90870237e-01\n",
      "  -8.46655428e-01  1.30234301e+00 -1.10058081e+00  1.66739866e-01\n",
      "   1.04790770e-01  4.78594787e-02 -1.18520463e+00 -8.67273211e-02\n",
      "   3.03515524e-01  9.13303971e-01 -1.48367262e+00  2.85297900e-01\n",
      "   1.17130375e+00 -5.70007443e-01  7.35067189e-01  9.56583142e-01\n",
      "  -4.96481001e-01 -5.06948307e-02  1.42762709e+00  7.95271814e-01\n",
      "  -1.32290280e+00  1.26184893e+00  4.88225251e-01 -6.88160630e-03\n",
      "   1.29425609e+00  6.30099773e-01  2.27187729e+00 -1.18026592e-01\n",
      "  -1.68324828e+00 -1.13266242e+00  2.08782926e-01  4.58698303e-01\n",
      "   1.89060724e+00  7.18977988e-01 -9.27839652e-02  7.80472517e-01\n",
      "  -2.09828329e+00  7.43498445e-01 -2.30418831e-01 -1.66411281e+00\n",
      "  -4.18454319e-01 -1.43767941e+00  3.89741957e-01  2.36602947e-01\n",
      "  -7.43958235e-01 -2.02826679e-01  1.01292133e+00 -3.13007295e-01\n",
      "  -3.81548882e-01 -1.96593091e-01  7.42237687e-01 -5.20869764e-03\n",
      "  -1.12578201e+00  9.82620835e-01  1.29543781e-01  8.86780739e-01\n",
      "  -4.34419543e-01  7.22968400e-01 -9.53904331e-01 -7.74392068e-01\n",
      "   2.10776642e-01 -5.27780131e-02  5.60456336e-01  1.32984865e+00\n",
      "  -3.28346223e-01 -9.92349982e-01  1.10324286e-01  5.19186817e-02\n",
      "  -1.04951859e+00 -8.46211076e-01  2.09358454e+00 -4.04440045e-01\n",
      "   3.33502203e-01 -6.98575318e-01  7.16578007e-01 -1.37721169e+00\n",
      "  -6.39053226e-01 -3.59718770e-01  1.48277509e+00 -4.92995471e-01\n",
      "  -9.03227031e-01 -3.57226998e-01 -3.56774598e-01  6.48704231e-01\n",
      "   7.55370855e-01  8.85617211e-02 -6.74980164e-01 -2.74456203e-01\n",
      "   5.51243484e-01  1.36739707e+00 -1.05495512e+00 -4.60769176e-01\n",
      "  -1.19583488e-01 -1.58996725e+00 -1.43389463e+00 -3.10228139e-01\n",
      "  -8.04113567e-01  3.86258096e-01 -9.93884206e-01 -2.09635105e-02\n",
      "   8.26042235e-01  3.04396689e-01  2.18830287e-01 -4.66364890e-01\n",
      "   4.27126348e-01 -5.96553445e-01  2.85198003e-01  8.55533242e-01\n",
      "   2.53500402e-01 -9.23197329e-01  7.31422663e-01  1.53586853e+00\n",
      "   7.65948594e-01 -6.48502052e-01 -3.44378024e-01 -1.36694598e+00\n",
      "  -1.73115373e-01 -5.25088191e-01 -6.40281618e-01  5.60511887e-01\n",
      "   3.87747228e-01 -2.11385131e+00 -1.60256708e+00 -2.11401433e-01\n",
      "   4.20377851e-02 -2.95392036e-01  5.39766431e-01 -1.03873813e+00\n",
      "  -6.56823814e-01  5.77620447e-01  1.54575205e+00  8.90883088e-01]\n",
      " [ 1.16279280e+00  1.13483965e+00  1.88555941e-01 -2.83648282e-01\n",
      "   1.71342158e+00 -5.29036701e-01  1.71523929e-01 -1.39294899e+00\n",
      "   7.96781838e-01  9.19208825e-01 -1.57934546e+00 -8.07266712e-01\n",
      "   9.52753663e-01 -8.34115326e-01  4.17516798e-01  4.11997914e-01\n",
      "   6.91036522e-01 -5.48615277e-01 -1.20340213e-01 -1.11631370e+00\n",
      "   7.28128493e-01  1.89322162e+00 -1.11563660e-01 -3.53863537e-01\n",
      "  -1.49574280e-01 -3.55549097e-01 -4.39724922e-01  1.33251595e+00\n",
      "  -1.25674784e+00 -3.78545135e-01 -1.18000582e-01  1.61529315e+00\n",
      "  -1.57197428e+00 -1.44980502e+00 -4.32287902e-01  1.02225220e+00\n",
      "  -1.49362826e+00 -8.98910761e-01  3.95324051e-01  1.54736924e+00\n",
      "   1.14564979e+00  1.32987404e+00  9.12621021e-01  8.63275945e-01\n",
      "  -8.96675944e-01 -4.67576146e-01 -6.98572099e-02  4.43748057e-01\n",
      "  -4.57489938e-01  6.83359921e-01  1.20497197e-01  4.75123048e-01\n",
      "   1.08343303e+00 -4.41536844e-01  6.70729876e-01  1.89813221e+00\n",
      "  -2.04714924e-01 -2.22229317e-01 -2.43551388e-01  5.03778271e-02\n",
      "   9.94830012e-01 -4.95808363e-01  7.15595305e-01 -1.76503152e-01\n",
      "  -8.72252643e-01  1.96934506e-01  1.89908445e+00  1.18391716e+00\n",
      "  -1.11120641e-01 -7.48716621e-03 -1.73150003e-01  3.08158509e-02\n",
      "  -1.92714795e-01  5.02657481e-02 -2.28244141e-01 -1.61577201e+00\n",
      "  -7.30780423e-01  8.86083961e-01  3.86612952e-01  4.46586549e-01\n",
      "   1.38593584e-01 -4.58368957e-01  1.08507383e+00 -2.63792396e-01\n",
      "  -7.67737627e-01 -3.82013828e-01  1.14414573e+00 -3.09496254e-01\n",
      "   3.80302250e-01  1.32167232e+00 -5.81279933e-01  3.51301700e-01\n",
      "   2.57559490e+00  1.88407314e+00  6.35705829e-01  4.35529500e-01\n",
      "  -6.78939402e-01 -1.75795650e+00 -1.32220662e+00 -1.39055717e+00\n",
      "   1.32807887e+00  6.77061915e-01 -9.12168622e-02  6.40626431e-01\n",
      "  -4.55685794e-01 -3.29089642e-01 -8.20429921e-01  5.68989456e-01\n",
      "   1.46499738e-01  4.08822656e-01  9.08273041e-01 -5.15285432e-01\n",
      "  -7.49034822e-01  3.37679386e-01  9.72603798e-01  7.88553238e-01\n",
      "   1.28493294e-01  5.26232064e-01 -4.68014255e-02  4.52542454e-01\n",
      "  -1.57514572e+00 -1.88961402e-01 -1.69241083e+00 -5.69223523e-01\n",
      "   5.03444314e-01  5.04174829e-01  1.60484529e+00 -1.45485425e+00\n",
      "  -3.15966487e-01 -1.27785480e+00  2.21990347e+00 -1.46582079e+00\n",
      "  -2.64501959e-01  2.98206717e-01 -9.03944254e-01 -1.82968545e+00\n",
      "   2.09351707e+00  1.30079865e-01  4.83079910e-01  1.91796386e+00\n",
      "   4.99718338e-01 -1.29393494e+00  1.14754069e+00 -4.20013577e-01\n",
      "  -1.45194364e+00 -1.69764906e-01  2.06712738e-01  1.72467887e-01\n",
      "  -4.54055995e-01  6.74922392e-02 -2.02881455e-01  5.09818852e-01\n",
      "   1.35828304e+00 -1.88782823e+00 -8.57934952e-01  1.21055198e+00\n",
      "  -4.72373784e-01 -2.92584896e-01 -3.41244370e-01 -3.90897810e-01\n",
      "  -1.59735072e+00 -2.86274880e-01  1.16348827e+00 -6.12659156e-01\n",
      "   1.13596642e+00  5.74865043e-01  4.00789618e-01 -3.61971371e-02\n",
      "   1.05137002e+00 -5.62362611e-01 -1.74421525e+00 -1.56791949e+00\n",
      "   4.19774294e-01  1.04751945e+00 -1.24671650e+00 -4.42945451e-01\n",
      "   7.67488658e-01 -7.74724185e-01  1.57270893e-01  5.49942136e-01\n",
      "  -1.07578635e+00 -1.53598523e+00 -1.10366851e-01 -1.36313975e+00\n",
      "   8.63460124e-01 -5.60034215e-01 -7.27580309e-01  5.48401892e-01\n",
      "  -1.18148434e+00  3.33230019e-01 -2.01980636e-01 -5.52355528e-01\n",
      "  -1.16578090e+00 -3.68941203e-02  1.23969901e+00  9.64874804e-01\n",
      "   7.24965692e-01 -6.91145122e-01  3.22984666e-01 -7.96021581e-01]]\n",
      "<NDArray 4x200 @cpu(0)>\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch 1,loss 310246.531250\n",
      "epoch 2,loss 104016.132812\n",
      "epoch 3,loss 92423.046875\n",
      "epoch 4,loss 89015.789062\n",
      "epoch 5,loss 85822.429688\n",
      "epoch 6,loss 83194.148438\n",
      "epoch 7,loss 80764.976562\n",
      "epoch 8,loss 78252.312500\n",
      "epoch 9,loss 76018.304688\n",
      "epoch 10,loss 73918.265625\n",
      "epoch 11,loss 71708.101562\n",
      "epoch 12,loss 69541.148438\n",
      "epoch 13,loss 67791.109375\n",
      "epoch 14,loss 65256.851562\n",
      "epoch 15,loss 63233.777344\n",
      "epoch 16,loss 61194.523438\n",
      "epoch 17,loss 59187.093750\n",
      "epoch 18,loss 57320.898438\n",
      "epoch 19,loss 55519.621094\n",
      "epoch 20,loss 53719.058594\n",
      "epoch 21,loss 52090.023438\n",
      "epoch 22,loss 50514.988281\n",
      "epoch 23,loss 48839.335938\n",
      "epoch 24,loss 47326.738281\n",
      "epoch 25,loss 46069.312500\n",
      "epoch 26,loss 44585.960938\n",
      "epoch 27,loss 43363.480469\n",
      "epoch 28,loss 42173.804688\n",
      "epoch 29,loss 41144.828125\n",
      "epoch 30,loss 39982.804688\n",
      "epoch 31,loss 39071.453125\n",
      "epoch 32,loss 38257.792969\n",
      "epoch 33,loss 37213.828125\n",
      "epoch 34,loss 36671.207031\n",
      "epoch 35,loss 35678.058594\n",
      "epoch 36,loss 34883.210938\n",
      "epoch 37,loss 34297.941406\n",
      "epoch 38,loss 33711.367188\n",
      "epoch 39,loss 32991.308594\n",
      "epoch 40,loss 32463.474609\n",
      "epoch 41,loss 31907.681641\n",
      "epoch 42,loss 31340.515625\n",
      "epoch 43,loss 30916.039062\n",
      "epoch 44,loss 30397.371094\n",
      "epoch 45,loss 30023.625000\n",
      "epoch 46,loss 29629.791016\n",
      "epoch 47,loss 29602.759766\n",
      "epoch 48,loss 29029.500000\n",
      "epoch 49,loss 28685.212891\n",
      "epoch 50,loss 28313.755859\n",
      "epoch 51,loss 28065.353516\n",
      "epoch 52,loss 27911.208984\n",
      "epoch 53,loss 27660.648438\n",
      "epoch 54,loss 27621.875000\n",
      "epoch 55,loss 27319.673828\n",
      "epoch 56,loss 27228.076172\n",
      "epoch 57,loss 27079.591797\n",
      "epoch 58,loss 26921.576172\n",
      "epoch 59,loss 26803.316406\n",
      "epoch 60,loss 26777.392578\n",
      "epoch 61,loss 26586.406250\n",
      "epoch 62,loss 26460.955078\n",
      "epoch 63,loss 26289.287109\n",
      "epoch 64,loss 26216.919922\n",
      "epoch 65,loss 26226.222656\n",
      "epoch 66,loss 26087.828125\n",
      "epoch 67,loss 25892.031250\n",
      "epoch 68,loss 25834.677734\n",
      "epoch 69,loss 25798.193359\n",
      "epoch 70,loss 25794.582031\n",
      "epoch 71,loss 25731.154297\n",
      "epoch 72,loss 25586.710938\n",
      "epoch 73,loss 25595.474609\n",
      "epoch 74,loss 25697.644531\n",
      "epoch 75,loss 25521.468750\n",
      "epoch 76,loss 25569.712891\n",
      "epoch 77,loss 25459.560547\n",
      "epoch 78,loss 25378.777344\n",
      "epoch 79,loss 25225.371094\n",
      "epoch 80,loss 25423.285156\n",
      "epoch 81,loss 25203.296875\n",
      "epoch 82,loss 25047.275391\n",
      "epoch 83,loss 25065.451172\n",
      "epoch 84,loss 24951.306641\n",
      "epoch 85,loss 25000.300781\n",
      "epoch 86,loss 24937.058594\n",
      "epoch 87,loss 24923.244141\n",
      "epoch 88,loss 24809.164062\n",
      "epoch 89,loss 24775.240234\n",
      "epoch 90,loss 24845.423828\n",
      "epoch 91,loss 24699.462891\n",
      "epoch 92,loss 24662.533203\n",
      "epoch 93,loss 24590.650391\n",
      "epoch 94,loss 24660.226562\n",
      "epoch 95,loss 24511.000000\n",
      "epoch 96,loss 24507.154297\n",
      "epoch 97,loss 24470.005859\n",
      "epoch 98,loss 24569.875000\n",
      "epoch 99,loss 24396.111328\n",
      "epoch 100,loss 24382.939453\n",
      "epoch 101,loss 24322.941406\n",
      "epoch 102,loss 24379.921875\n",
      "epoch 103,loss 24319.144531\n",
      "epoch 104,loss 24328.142578\n",
      "epoch 105,loss 24268.650391\n",
      "epoch 106,loss 24176.052734\n",
      "epoch 107,loss 24272.662109\n",
      "epoch 108,loss 24178.763672\n",
      "epoch 109,loss 24155.052734\n",
      "epoch 110,loss 24100.886719\n",
      "epoch 111,loss 24023.773438\n",
      "epoch 112,loss 24055.773438\n",
      "epoch 113,loss 23983.222656\n",
      "epoch 114,loss 24319.529297\n",
      "epoch 115,loss 23976.728516\n",
      "epoch 116,loss 23837.546875\n",
      "epoch 117,loss 23959.990234\n",
      "epoch 118,loss 23824.371094\n",
      "epoch 119,loss 23886.037109\n",
      "epoch 120,loss 23719.755859\n",
      "epoch 121,loss 23688.761719\n",
      "epoch 122,loss 23724.070312\n",
      "epoch 123,loss 23667.525391\n",
      "epoch 124,loss 23661.642578\n",
      "epoch 125,loss 23705.486328\n",
      "epoch 126,loss 23563.251953\n",
      "epoch 127,loss 23615.849609\n",
      "epoch 128,loss 23507.021484\n",
      "epoch 129,loss 23521.917969\n",
      "epoch 130,loss 23519.060547\n",
      "epoch 131,loss 24087.947266\n",
      "epoch 132,loss 23456.296875\n",
      "epoch 133,loss 23370.275391\n",
      "epoch 134,loss 23362.970703\n",
      "epoch 135,loss 23716.617188\n",
      "epoch 136,loss 23264.248047\n",
      "epoch 137,loss 23336.115234\n",
      "epoch 138,loss 23249.376953\n",
      "epoch 139,loss 23191.787109\n",
      "epoch 140,loss 23258.218750\n",
      "epoch 141,loss 23224.130859\n",
      "epoch 142,loss 23116.054688\n",
      "epoch 143,loss 23251.416016\n",
      "epoch 144,loss 23123.828125\n",
      "epoch 145,loss 23460.244141\n",
      "epoch 146,loss 22968.488281\n",
      "epoch 147,loss 23172.453125\n",
      "epoch 148,loss 22915.316406\n",
      "epoch 149,loss 23249.148438\n",
      "epoch 150,loss 22941.376953\n",
      "epoch 151,loss 22798.986328\n",
      "epoch 152,loss 22669.763672\n",
      "epoch 153,loss 22758.439453\n",
      "epoch 154,loss 22861.777344\n",
      "epoch 155,loss 22561.947266\n",
      "epoch 156,loss 22663.042969\n",
      "epoch 157,loss 22520.906250\n",
      "epoch 158,loss 22478.031250\n",
      "epoch 159,loss 22568.843750\n",
      "epoch 160,loss 22525.916016\n",
      "epoch 161,loss 22441.656250\n",
      "epoch 162,loss 22380.517578\n",
      "epoch 163,loss 22365.244141\n",
      "epoch 164,loss 22721.343750\n",
      "epoch 165,loss 22444.951172\n",
      "epoch 166,loss 22278.939453\n",
      "epoch 167,loss 22212.882812\n",
      "epoch 168,loss 22179.654297\n",
      "epoch 169,loss 22094.998047\n",
      "epoch 170,loss 22248.324219\n",
      "epoch 171,loss 22002.546875\n",
      "epoch 172,loss 22124.648438\n",
      "epoch 173,loss 21981.679688\n",
      "epoch 174,loss 21917.908203\n",
      "epoch 175,loss 21972.333984\n",
      "epoch 176,loss 21950.574219\n",
      "epoch 177,loss 21960.851562\n",
      "epoch 178,loss 22177.457031\n",
      "epoch 179,loss 21767.302734\n",
      "epoch 180,loss 21965.097656\n",
      "epoch 181,loss 21737.103516\n",
      "epoch 182,loss 21734.902344\n",
      "epoch 183,loss 21652.623047\n",
      "epoch 184,loss 21744.548828\n",
      "epoch 185,loss 21683.658203\n",
      "epoch 186,loss 21786.812500\n",
      "epoch 187,loss 21639.437500\n",
      "epoch 188,loss 21604.728516\n",
      "epoch 189,loss 21743.238281\n",
      "epoch 190,loss 21536.191406\n",
      "epoch 191,loss 21442.345703\n",
      "epoch 192,loss 21598.103516\n",
      "epoch 193,loss 21424.759766\n",
      "epoch 194,loss 21460.482422\n",
      "epoch 195,loss 21440.183594\n",
      "epoch 196,loss 21413.574219\n",
      "epoch 197,loss 21617.611328\n",
      "epoch 198,loss 21292.429688\n",
      "epoch 199,loss 21248.923828\n",
      "epoch 200,loss 21621.816406\n",
      "epoch 201,loss 21248.837891\n",
      "epoch 202,loss 21181.257812\n",
      "epoch 203,loss 21447.220703\n",
      "epoch 204,loss 21145.619141\n",
      "epoch 205,loss 21218.257812\n",
      "epoch 206,loss 21189.203125\n",
      "epoch 207,loss 21257.396484\n",
      "epoch 208,loss 21203.794922\n",
      "epoch 209,loss 21052.677734\n",
      "epoch 210,loss 20867.503906\n",
      "epoch 211,loss 20842.488281\n",
      "epoch 212,loss 20849.009766\n",
      "epoch 213,loss 20769.392578\n",
      "epoch 214,loss 20717.845703\n",
      "epoch 215,loss 20699.957031\n",
      "epoch 216,loss 21035.453125\n",
      "epoch 217,loss 20580.677734\n",
      "epoch 218,loss 20842.408203\n",
      "epoch 219,loss 20611.232422\n",
      "epoch 220,loss 20582.755859\n",
      "epoch 221,loss 20500.525391\n",
      "epoch 222,loss 20475.365234\n",
      "epoch 223,loss 20523.367188\n",
      "epoch 224,loss 20377.589844\n",
      "epoch 225,loss 20364.740234\n",
      "epoch 226,loss 20414.339844\n",
      "epoch 227,loss 20442.916016\n",
      "epoch 228,loss 20232.220703\n",
      "epoch 229,loss 20342.320312\n",
      "epoch 230,loss 20211.580078\n",
      "epoch 231,loss 20144.083984\n",
      "epoch 232,loss 20217.865234\n",
      "epoch 233,loss 20084.535156\n",
      "epoch 234,loss 20286.882812\n",
      "epoch 235,loss 20111.564453\n",
      "epoch 236,loss 20133.849609\n",
      "epoch 237,loss 20115.244141\n",
      "epoch 238,loss 20031.779297\n",
      "epoch 239,loss 19958.246094\n",
      "epoch 240,loss 20029.794922\n",
      "epoch 241,loss 20067.101562\n",
      "epoch 242,loss 20041.203125\n",
      "epoch 243,loss 19922.496094\n",
      "epoch 244,loss 19973.558594\n",
      "epoch 245,loss 19838.673828\n",
      "epoch 246,loss 19840.732422\n",
      "epoch 247,loss 19883.236328\n",
      "epoch 248,loss 19987.333984\n",
      "epoch 249,loss 19759.804688\n",
      "epoch 250,loss 19826.712891\n",
      "epoch 251,loss 20356.070312\n",
      "epoch 252,loss 19703.642578\n",
      "epoch 253,loss 19875.263672\n",
      "epoch 254,loss 19717.498047\n",
      "epoch 255,loss 19801.982422\n",
      "epoch 256,loss 19675.470703\n",
      "epoch 257,loss 19606.449219\n",
      "epoch 258,loss 19726.431641\n",
      "epoch 259,loss 19785.576172\n",
      "epoch 260,loss 19600.890625\n",
      "epoch 261,loss 19524.703125\n",
      "epoch 262,loss 19523.341797\n",
      "epoch 263,loss 19707.679688\n",
      "epoch 264,loss 19552.291016\n",
      "epoch 265,loss 19494.296875\n",
      "epoch 266,loss 19474.205078\n",
      "epoch 267,loss 19533.806641\n",
      "epoch 268,loss 19501.371094\n",
      "epoch 269,loss 19402.091797\n",
      "epoch 270,loss 19533.171875\n",
      "epoch 271,loss 19367.058594\n",
      "epoch 272,loss 19429.068359\n",
      "epoch 273,loss 19384.564453\n",
      "epoch 274,loss 19513.533203\n",
      "epoch 275,loss 19424.755859\n",
      "epoch 276,loss 19288.666016\n",
      "epoch 277,loss 19401.437500\n",
      "epoch 278,loss 19251.052734\n",
      "epoch 279,loss 19265.746094\n",
      "epoch 280,loss 19814.613281\n",
      "epoch 281,loss 19652.552734\n",
      "epoch 282,loss 19231.490234\n",
      "epoch 283,loss 19211.921875\n",
      "epoch 284,loss 19289.789062\n",
      "epoch 285,loss 19155.289062\n",
      "epoch 286,loss 19176.552734\n",
      "epoch 287,loss 19273.441406\n",
      "epoch 288,loss 19187.835938\n",
      "epoch 289,loss 19087.103516\n",
      "epoch 290,loss 19076.345703\n",
      "epoch 291,loss 19116.634766\n",
      "epoch 292,loss 19040.853516\n",
      "epoch 293,loss 19107.546875\n",
      "epoch 294,loss 19368.720703\n",
      "epoch 295,loss 19110.060547\n",
      "epoch 296,loss 18992.320312\n",
      "epoch 297,loss 19210.134766\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch 298,loss 19025.501953\n",
      "epoch 299,loss 19105.513672\n",
      "epoch 300,loss 18937.343750\n",
      "epoch 301,loss 19115.791016\n",
      "epoch 302,loss 18903.005859\n",
      "epoch 303,loss 19035.093750\n",
      "epoch 304,loss 18944.585938\n",
      "epoch 305,loss 18970.058594\n",
      "epoch 306,loss 18821.214844\n",
      "epoch 307,loss 19111.052734\n",
      "epoch 308,loss 18811.464844\n",
      "epoch 309,loss 18815.140625\n",
      "epoch 310,loss 18867.722656\n",
      "epoch 311,loss 18884.667969\n",
      "epoch 312,loss 18737.046875\n",
      "epoch 313,loss 18712.296875\n",
      "epoch 314,loss 18855.539062\n",
      "epoch 315,loss 18714.164062\n",
      "epoch 316,loss 18944.410156\n",
      "epoch 317,loss 18690.777344\n",
      "epoch 318,loss 18625.730469\n",
      "epoch 319,loss 18694.144531\n",
      "epoch 320,loss 18642.316406\n",
      "epoch 321,loss 18901.644531\n",
      "epoch 322,loss 18699.480469\n",
      "epoch 323,loss 18900.111328\n",
      "epoch 324,loss 18537.980469\n",
      "epoch 325,loss 18536.550781\n",
      "epoch 326,loss 18792.804688\n",
      "epoch 327,loss 18517.658203\n",
      "epoch 328,loss 18477.566406\n",
      "epoch 329,loss 18601.662109\n",
      "epoch 330,loss 18508.554688\n",
      "epoch 331,loss 18420.695312\n",
      "epoch 332,loss 18496.777344\n",
      "epoch 333,loss 18427.890625\n",
      "epoch 334,loss 18462.855469\n",
      "epoch 335,loss 18606.152344\n",
      "epoch 336,loss 18355.248047\n",
      "epoch 337,loss 18376.761719\n",
      "epoch 338,loss 18352.751953\n",
      "epoch 339,loss 18807.005859\n",
      "epoch 340,loss 18311.214844\n",
      "epoch 341,loss 18312.701172\n",
      "epoch 342,loss 18254.367188\n",
      "epoch 343,loss 18301.626953\n",
      "epoch 344,loss 18228.074219\n",
      "epoch 345,loss 18716.781250\n",
      "epoch 346,loss 18409.343750\n",
      "epoch 347,loss 18187.037109\n",
      "epoch 348,loss 18283.845703\n",
      "epoch 349,loss 18320.421875\n",
      "epoch 350,loss 18113.853516\n",
      "epoch 351,loss 18267.923828\n",
      "epoch 352,loss 18182.212891\n",
      "epoch 353,loss 18316.779297\n",
      "epoch 354,loss 18107.869141\n",
      "epoch 355,loss 18067.828125\n",
      "epoch 356,loss 18186.503906\n",
      "epoch 357,loss 18010.414062\n",
      "epoch 358,loss 18042.269531\n",
      "epoch 359,loss 18269.792969\n",
      "epoch 360,loss 18025.646484\n",
      "epoch 361,loss 18067.908203\n",
      "epoch 362,loss 17974.132812\n",
      "epoch 363,loss 18110.384766\n",
      "epoch 364,loss 17963.599609\n",
      "epoch 365,loss 17909.986328\n",
      "epoch 366,loss 17872.996094\n",
      "epoch 367,loss 18224.013672\n",
      "epoch 368,loss 18079.962891\n",
      "epoch 369,loss 17857.083984\n",
      "epoch 370,loss 17821.472656\n",
      "epoch 371,loss 18035.470703\n",
      "epoch 372,loss 17813.275391\n",
      "epoch 373,loss 17778.138672\n",
      "epoch 374,loss 17915.644531\n",
      "epoch 375,loss 17878.347656\n",
      "epoch 376,loss 17746.769531\n",
      "epoch 377,loss 17806.398438\n",
      "epoch 378,loss 17723.341797\n",
      "epoch 379,loss 17791.222656\n",
      "epoch 380,loss 18169.906250\n",
      "epoch 381,loss 17779.246094\n",
      "epoch 382,loss 17671.488281\n",
      "epoch 383,loss 17739.070312\n",
      "epoch 384,loss 18035.314453\n",
      "epoch 385,loss 17774.724609\n",
      "epoch 386,loss 17631.419922\n",
      "epoch 387,loss 17696.189453\n",
      "epoch 388,loss 17601.175781\n",
      "epoch 389,loss 17590.808594\n",
      "epoch 390,loss 17560.482422\n",
      "epoch 391,loss 17670.279297\n",
      "epoch 392,loss 17646.119141\n",
      "epoch 393,loss 17592.095703\n",
      "epoch 394,loss 17973.681641\n",
      "epoch 395,loss 17706.978516\n",
      "epoch 396,loss 17620.728516\n",
      "epoch 397,loss 18002.345703\n",
      "epoch 398,loss 17504.580078\n",
      "epoch 399,loss 17651.328125\n",
      "epoch 400,loss 17418.031250\n",
      "epoch 401,loss 17537.404297\n",
      "epoch 402,loss 17486.369141\n",
      "epoch 403,loss 17641.789062\n",
      "epoch 404,loss 17584.777344\n",
      "epoch 405,loss 17482.722656\n",
      "epoch 406,loss 17305.050781\n",
      "epoch 407,loss 17744.816406\n",
      "epoch 408,loss 17281.863281\n",
      "epoch 409,loss 17298.076172\n",
      "epoch 410,loss 17590.886719\n",
      "epoch 411,loss 17237.496094\n",
      "epoch 412,loss 17367.548828\n",
      "epoch 413,loss 17404.951172\n",
      "epoch 414,loss 17600.164062\n",
      "epoch 415,loss 17209.363281\n",
      "epoch 416,loss 17176.492188\n",
      "epoch 417,loss 17210.648438\n",
      "epoch 418,loss 17425.550781\n",
      "epoch 419,loss 17164.003906\n",
      "epoch 420,loss 17200.093750\n",
      "epoch 421,loss 17102.220703\n",
      "epoch 422,loss 17111.777344\n",
      "epoch 423,loss 17095.740234\n",
      "epoch 424,loss 17061.449219\n",
      "epoch 425,loss 17103.447266\n",
      "epoch 426,loss 17076.744141\n",
      "epoch 427,loss 17140.189453\n",
      "epoch 428,loss 17318.769531\n",
      "epoch 429,loss 17173.640625\n",
      "epoch 430,loss 17061.599609\n",
      "epoch 431,loss 16979.445312\n",
      "epoch 432,loss 16964.416016\n",
      "epoch 433,loss 16976.726562\n",
      "epoch 434,loss 17047.410156\n",
      "epoch 435,loss 17015.214844\n",
      "epoch 436,loss 16969.207031\n",
      "epoch 437,loss 16969.900391\n",
      "epoch 438,loss 17168.466797\n",
      "epoch 439,loss 16886.458984\n",
      "epoch 440,loss 16899.904297\n",
      "epoch 441,loss 17183.310547\n",
      "epoch 442,loss 17055.673828\n",
      "epoch 443,loss 16930.218750\n",
      "epoch 444,loss 16804.613281\n",
      "epoch 445,loss 16798.091797\n",
      "epoch 446,loss 16778.218750\n",
      "epoch 447,loss 16873.408203\n",
      "epoch 448,loss 16978.134766\n",
      "epoch 449,loss 16746.158203\n",
      "epoch 450,loss 17067.896484\n",
      "epoch 451,loss 16741.619141\n",
      "epoch 452,loss 16704.673828\n",
      "epoch 453,loss 16699.761719\n",
      "epoch 454,loss 16685.148438\n",
      "epoch 455,loss 17008.933594\n",
      "epoch 456,loss 16652.962891\n",
      "epoch 457,loss 16779.416016\n",
      "epoch 458,loss 16689.316406\n",
      "epoch 459,loss 16674.146484\n",
      "epoch 460,loss 16633.835938\n",
      "epoch 461,loss 16621.457031\n",
      "epoch 462,loss 16807.210938\n",
      "epoch 463,loss 16598.152344\n",
      "epoch 464,loss 16571.595703\n",
      "epoch 465,loss 16736.140625\n",
      "epoch 466,loss 16538.207031\n",
      "epoch 467,loss 16595.738281\n",
      "epoch 468,loss 16993.632812\n",
      "epoch 469,loss 16998.138672\n",
      "epoch 470,loss 16592.775391\n",
      "epoch 471,loss 16491.533203\n",
      "epoch 472,loss 17030.468750\n",
      "epoch 473,loss 16496.941406\n",
      "epoch 474,loss 16489.535156\n",
      "epoch 475,loss 17625.441406\n",
      "epoch 476,loss 17322.740234\n",
      "epoch 477,loss 16424.154297\n",
      "epoch 478,loss 16448.744141\n",
      "epoch 479,loss 16707.921875\n",
      "epoch 480,loss 16766.111328\n",
      "epoch 481,loss 16443.142578\n",
      "epoch 482,loss 16590.992188\n",
      "epoch 483,loss 16438.892578\n",
      "epoch 484,loss 16841.673828\n",
      "epoch 485,loss 16332.228516\n",
      "epoch 486,loss 16349.505859\n",
      "epoch 487,loss 16301.379883\n",
      "epoch 488,loss 16396.736328\n",
      "epoch 489,loss 16557.746094\n",
      "epoch 490,loss 16293.669922\n",
      "epoch 491,loss 16494.542969\n",
      "epoch 492,loss 16506.714844\n",
      "epoch 493,loss 16247.290039\n",
      "epoch 494,loss 16315.277344\n",
      "epoch 495,loss 16233.886719\n",
      "epoch 496,loss 16322.462891\n",
      "epoch 497,loss 16295.943359\n",
      "epoch 498,loss 16453.460938\n",
      "epoch 499,loss 16277.329102\n",
      "epoch 500,loss 16273.366211\n",
      "epoch 501,loss 16155.049805\n",
      "epoch 502,loss 16189.710938\n",
      "epoch 503,loss 16215.266602\n",
      "epoch 504,loss 17686.595703\n",
      "epoch 505,loss 16121.903320\n",
      "epoch 506,loss 16360.892578\n",
      "epoch 507,loss 16279.953125\n",
      "epoch 508,loss 16186.245117\n",
      "epoch 509,loss 16089.566406\n",
      "epoch 510,loss 16114.874023\n",
      "epoch 511,loss 16123.353516\n",
      "epoch 512,loss 16086.138672\n",
      "epoch 513,loss 16050.749023\n",
      "epoch 514,loss 16016.498047\n",
      "epoch 515,loss 16354.675781\n",
      "epoch 516,loss 16138.683594\n",
      "epoch 517,loss 16049.105469\n",
      "epoch 518,loss 16466.546875\n",
      "epoch 519,loss 16067.409180\n",
      "epoch 520,loss 16167.083984\n",
      "epoch 521,loss 16140.507812\n",
      "epoch 522,loss 15984.493164\n",
      "epoch 523,loss 15985.338867\n",
      "epoch 524,loss 15990.714844\n",
      "epoch 525,loss 15983.411133\n",
      "epoch 526,loss 15928.555664\n",
      "epoch 527,loss 15927.051758\n",
      "epoch 528,loss 16054.916016\n",
      "epoch 529,loss 15872.628906\n",
      "epoch 530,loss 15966.196289\n",
      "epoch 531,loss 15884.204102\n",
      "epoch 532,loss 15854.283203\n",
      "epoch 533,loss 16025.690430\n",
      "epoch 534,loss 15934.780273\n",
      "epoch 535,loss 16017.096680\n",
      "epoch 536,loss 15986.636719\n",
      "epoch 537,loss 16012.555664\n",
      "epoch 538,loss 15801.797852\n",
      "epoch 539,loss 15922.921875\n",
      "epoch 540,loss 15798.974609\n",
      "epoch 541,loss 16004.301758\n",
      "epoch 542,loss 15758.040039\n",
      "epoch 543,loss 15874.625977\n",
      "epoch 544,loss 15775.544922\n",
      "epoch 545,loss 15844.360352\n",
      "epoch 546,loss 15745.670898\n",
      "epoch 547,loss 15772.331055\n",
      "epoch 548,loss 15756.620117\n",
      "epoch 549,loss 15959.272461\n",
      "epoch 550,loss 15763.232422\n",
      "epoch 551,loss 15715.400391\n",
      "epoch 552,loss 15767.888672\n",
      "epoch 553,loss 15996.607422\n",
      "epoch 554,loss 15678.258789\n",
      "epoch 555,loss 15781.198242\n",
      "epoch 556,loss 15780.702148\n",
      "epoch 557,loss 15659.244141\n",
      "epoch 558,loss 16096.772461\n",
      "epoch 559,loss 15665.932617\n",
      "epoch 560,loss 15884.500977\n",
      "epoch 561,loss 15829.523438\n",
      "epoch 562,loss 15719.619141\n",
      "epoch 563,loss 15581.951172\n",
      "epoch 564,loss 15655.088867\n",
      "epoch 565,loss 15764.155273\n",
      "epoch 566,loss 15570.237305\n",
      "epoch 567,loss 15884.932617\n",
      "epoch 568,loss 15601.909180\n",
      "epoch 569,loss 16400.773438\n",
      "epoch 570,loss 15578.585938\n",
      "epoch 571,loss 15692.226562\n",
      "epoch 572,loss 16152.948242\n",
      "epoch 573,loss 15536.591797\n",
      "epoch 574,loss 16224.794922\n",
      "epoch 575,loss 15494.465820\n",
      "epoch 576,loss 15527.800781\n",
      "epoch 577,loss 15468.720703\n",
      "epoch 578,loss 15465.166992\n",
      "epoch 579,loss 15660.137695\n",
      "epoch 580,loss 15443.768555\n",
      "epoch 581,loss 15980.045898\n",
      "epoch 582,loss 15550.787109\n",
      "epoch 583,loss 15552.682617\n",
      "epoch 584,loss 15464.063477\n",
      "epoch 585,loss 15556.436523\n",
      "epoch 586,loss 15482.749023\n",
      "epoch 587,loss 15458.123047\n",
      "epoch 588,loss 15420.016602\n",
      "epoch 589,loss 15427.438477\n",
      "epoch 590,loss 15406.398438\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch 591,loss 15365.285156\n",
      "epoch 592,loss 15590.435547\n",
      "epoch 593,loss 15346.868164\n",
      "epoch 594,loss 15386.783203\n",
      "epoch 595,loss 15332.299805\n",
      "epoch 596,loss 15381.569336\n",
      "epoch 597,loss 15456.997070\n",
      "epoch 598,loss 15334.262695\n",
      "epoch 599,loss 15474.057617\n",
      "epoch 600,loss 15304.580078\n",
      "epoch 601,loss 15473.319336\n",
      "epoch 602,loss 15300.146484\n",
      "epoch 603,loss 15423.056641\n",
      "epoch 604,loss 15383.429688\n",
      "epoch 605,loss 15334.007812\n",
      "epoch 606,loss 15272.563477\n",
      "epoch 607,loss 15250.538086\n",
      "epoch 608,loss 15262.838867\n",
      "epoch 609,loss 15380.305664\n",
      "epoch 610,loss 15388.164062\n",
      "epoch 611,loss 15256.252930\n",
      "epoch 612,loss 15318.357422\n",
      "epoch 613,loss 15515.343750\n",
      "epoch 614,loss 15329.188477\n",
      "epoch 615,loss 15477.924805\n",
      "epoch 616,loss 15539.667969\n",
      "epoch 617,loss 15234.888672\n",
      "epoch 618,loss 15192.698242\n",
      "epoch 619,loss 15372.508789\n",
      "epoch 620,loss 15322.712891\n",
      "epoch 621,loss 15154.795898\n",
      "epoch 622,loss 15237.425781\n",
      "epoch 623,loss 15301.462891\n",
      "epoch 624,loss 15184.027344\n",
      "epoch 625,loss 15761.524414\n",
      "epoch 626,loss 15150.285156\n",
      "epoch 627,loss 15242.540039\n",
      "epoch 628,loss 15633.414062\n",
      "epoch 629,loss 15190.106445\n",
      "epoch 630,loss 15157.160156\n",
      "epoch 631,loss 15545.081055\n",
      "epoch 632,loss 15621.936523\n",
      "epoch 633,loss 15133.346680\n",
      "epoch 634,loss 15259.143555\n",
      "epoch 635,loss 15360.016602\n",
      "epoch 636,loss 15104.836914\n",
      "epoch 637,loss 15369.654297\n",
      "epoch 638,loss 15088.153320\n",
      "epoch 639,loss 15068.169922\n",
      "epoch 640,loss 15029.694336\n",
      "epoch 641,loss 16252.749023\n",
      "epoch 642,loss 15032.335938\n",
      "epoch 643,loss 15349.975586\n",
      "epoch 644,loss 15012.387695\n",
      "epoch 645,loss 15040.683594\n",
      "epoch 646,loss 15007.987305\n",
      "epoch 647,loss 15047.957031\n",
      "epoch 648,loss 15038.388672\n",
      "epoch 649,loss 15134.455078\n",
      "epoch 650,loss 15043.200195\n",
      "epoch 651,loss 14963.466797\n",
      "epoch 652,loss 15112.639648\n",
      "epoch 653,loss 14975.198242\n",
      "epoch 654,loss 15122.726562\n",
      "epoch 655,loss 16539.519531\n",
      "epoch 656,loss 15215.205078\n",
      "epoch 657,loss 15020.403320\n",
      "epoch 658,loss 14936.817383\n",
      "epoch 659,loss 14936.718750\n",
      "epoch 660,loss 14909.841797\n",
      "epoch 661,loss 15250.299805\n",
      "epoch 662,loss 15010.346680\n",
      "epoch 663,loss 15359.416992\n",
      "epoch 664,loss 15077.113281\n",
      "epoch 665,loss 14935.948242\n",
      "epoch 666,loss 15172.561523\n",
      "epoch 667,loss 14924.669922\n",
      "epoch 668,loss 14868.425781\n",
      "epoch 669,loss 15158.541992\n",
      "epoch 670,loss 15066.409180\n",
      "epoch 671,loss 14853.468750\n",
      "epoch 672,loss 15705.235352\n",
      "epoch 673,loss 14935.085938\n",
      "epoch 674,loss 14866.775391\n",
      "epoch 675,loss 14832.153320\n",
      "epoch 676,loss 14834.789062\n",
      "epoch 677,loss 15323.775391\n",
      "epoch 678,loss 14885.792969\n",
      "epoch 679,loss 14915.328125\n",
      "epoch 680,loss 15413.731445\n",
      "epoch 681,loss 14892.167969\n",
      "epoch 682,loss 14889.314453\n",
      "epoch 683,loss 14815.564453\n",
      "epoch 684,loss 15083.375977\n",
      "epoch 685,loss 14841.692383\n",
      "epoch 686,loss 14767.506836\n",
      "epoch 687,loss 14898.819336\n",
      "epoch 688,loss 14814.196289\n",
      "epoch 689,loss 15008.220703\n",
      "epoch 690,loss 14766.258789\n",
      "epoch 691,loss 15050.633789\n",
      "epoch 692,loss 15232.352539\n",
      "epoch 693,loss 14758.105469\n",
      "epoch 694,loss 14898.733398\n",
      "epoch 695,loss 14720.096680\n",
      "epoch 696,loss 14843.715820\n",
      "epoch 697,loss 14791.901367\n",
      "epoch 698,loss 14731.185547\n",
      "epoch 699,loss 14696.890625\n",
      "epoch 700,loss 14767.540039\n",
      "epoch 701,loss 14741.504883\n",
      "epoch 702,loss 14684.477539\n",
      "epoch 703,loss 14722.666016\n",
      "epoch 704,loss 14993.356445\n",
      "epoch 705,loss 14703.804688\n",
      "epoch 706,loss 14715.363281\n",
      "epoch 707,loss 14682.531250\n",
      "epoch 708,loss 14689.366211\n",
      "epoch 709,loss 14705.556641\n",
      "epoch 710,loss 14724.403320\n",
      "epoch 711,loss 14901.428711\n",
      "epoch 712,loss 14868.281250\n",
      "epoch 713,loss 14880.531250\n",
      "epoch 714,loss 14795.644531\n",
      "epoch 715,loss 14656.575195\n",
      "epoch 716,loss 14619.763672\n",
      "epoch 717,loss 14869.009766\n",
      "epoch 718,loss 14659.934570\n",
      "epoch 719,loss 14685.268555\n",
      "epoch 720,loss 14933.066406\n",
      "epoch 721,loss 14603.916992\n",
      "epoch 722,loss 14592.177734\n",
      "epoch 723,loss 14648.767578\n",
      "epoch 724,loss 14710.481445\n",
      "epoch 725,loss 14617.450195\n",
      "epoch 726,loss 15215.676758\n",
      "epoch 727,loss 14563.710938\n",
      "epoch 728,loss 14603.686523\n",
      "epoch 729,loss 14617.010742\n",
      "epoch 730,loss 14552.807617\n",
      "epoch 731,loss 14589.683594\n",
      "epoch 732,loss 14552.522461\n",
      "epoch 733,loss 14630.537109\n",
      "epoch 734,loss 14694.914062\n",
      "epoch 735,loss 16550.349609\n",
      "epoch 736,loss 14626.224609\n",
      "epoch 737,loss 14659.324219\n",
      "epoch 738,loss 14489.433594\n",
      "epoch 739,loss 14476.881836\n",
      "epoch 740,loss 15122.652344\n",
      "epoch 741,loss 14857.093750\n",
      "epoch 742,loss 14703.305664\n",
      "epoch 743,loss 14750.874023\n",
      "epoch 744,loss 14554.413086\n",
      "epoch 745,loss 14590.331055\n",
      "epoch 746,loss 15034.019531\n",
      "epoch 747,loss 14561.901367\n",
      "epoch 748,loss 14440.040039\n",
      "epoch 749,loss 14575.559570\n",
      "epoch 750,loss 14465.772461\n",
      "epoch 751,loss 14882.291016\n",
      "epoch 752,loss 14434.030273\n",
      "epoch 753,loss 14451.749023\n",
      "epoch 754,loss 14499.866211\n",
      "epoch 755,loss 14496.871094\n",
      "epoch 756,loss 14638.624023\n",
      "epoch 757,loss 14396.795898\n",
      "epoch 758,loss 14772.930664\n",
      "epoch 759,loss 14506.498047\n",
      "epoch 760,loss 15797.057617\n",
      "epoch 761,loss 14446.099609\n",
      "epoch 762,loss 14378.037109\n",
      "epoch 763,loss 14354.166016\n",
      "epoch 764,loss 14407.469727\n",
      "epoch 765,loss 14383.556641\n",
      "epoch 766,loss 14411.285156\n",
      "epoch 767,loss 14345.572266\n",
      "epoch 768,loss 14426.056641\n",
      "epoch 769,loss 14757.877930\n",
      "epoch 770,loss 14371.102539\n",
      "epoch 771,loss 14432.625977\n",
      "epoch 772,loss 14485.448242\n",
      "epoch 773,loss 14864.450195\n",
      "epoch 774,loss 14498.024414\n",
      "epoch 775,loss 15112.085938\n",
      "epoch 776,loss 14294.708008\n",
      "epoch 777,loss 14702.216797\n",
      "epoch 778,loss 14369.064453\n",
      "epoch 779,loss 14416.945312\n",
      "epoch 780,loss 14316.693359\n",
      "epoch 781,loss 14771.010742\n",
      "epoch 782,loss 14384.148438\n",
      "epoch 783,loss 14436.959961\n",
      "epoch 784,loss 14407.113281\n",
      "epoch 785,loss 14241.855469\n",
      "epoch 786,loss 14264.727539\n",
      "epoch 787,loss 14524.794922\n",
      "epoch 788,loss 14230.049805\n",
      "epoch 789,loss 14240.339844\n",
      "epoch 790,loss 14231.995117\n",
      "epoch 791,loss 14480.700195\n",
      "epoch 792,loss 14551.239258\n",
      "epoch 793,loss 14203.336914\n",
      "epoch 794,loss 14211.854492\n",
      "epoch 795,loss 14538.266602\n",
      "epoch 796,loss 14432.339844\n",
      "epoch 797,loss 14189.375977\n",
      "epoch 798,loss 14198.595703\n",
      "epoch 799,loss 14181.698242\n",
      "epoch 800,loss 14189.676758\n",
      "epoch 801,loss 14228.630859\n",
      "epoch 802,loss 14213.476562\n",
      "epoch 803,loss 14453.958984\n",
      "epoch 804,loss 14207.330078\n",
      "epoch 805,loss 14168.517578\n",
      "epoch 806,loss 14282.816406\n",
      "epoch 807,loss 14567.589844\n",
      "epoch 808,loss 14435.075195\n",
      "epoch 809,loss 14355.254883\n",
      "epoch 810,loss 14476.716797\n",
      "epoch 811,loss 14175.242188\n",
      "epoch 812,loss 14125.042969\n",
      "epoch 813,loss 14242.562500\n",
      "epoch 814,loss 14243.307617\n",
      "epoch 815,loss 14114.072266\n",
      "epoch 816,loss 14329.064453\n",
      "epoch 817,loss 14148.421875\n",
      "epoch 818,loss 14197.090820\n",
      "epoch 819,loss 14746.112305\n",
      "epoch 820,loss 14580.662109\n",
      "epoch 821,loss 14225.223633\n",
      "epoch 822,loss 14351.127930\n",
      "epoch 823,loss 14265.634766\n",
      "epoch 824,loss 14120.284180\n",
      "epoch 825,loss 14113.188477\n",
      "epoch 826,loss 15257.254883\n",
      "epoch 827,loss 14116.896484\n",
      "epoch 828,loss 14257.386719\n",
      "epoch 829,loss 14161.895508\n",
      "epoch 830,loss 14081.355469\n",
      "epoch 831,loss 14095.140625\n",
      "epoch 832,loss 14106.422852\n",
      "epoch 833,loss 15165.353516\n",
      "epoch 834,loss 14059.495117\n",
      "epoch 835,loss 14043.983398\n",
      "epoch 836,loss 14105.805664\n",
      "epoch 837,loss 14063.844727\n",
      "epoch 838,loss 14104.185547\n",
      "epoch 839,loss 14045.892578\n",
      "epoch 840,loss 14106.265625\n",
      "epoch 841,loss 14121.618164\n",
      "epoch 842,loss 14025.739258\n",
      "epoch 843,loss 14123.965820\n",
      "epoch 844,loss 14062.262695\n",
      "epoch 845,loss 14147.936523\n",
      "epoch 846,loss 13994.288086\n",
      "epoch 847,loss 14443.394531\n",
      "epoch 848,loss 14000.690430\n",
      "epoch 849,loss 13981.187500\n",
      "epoch 850,loss 14048.527344\n",
      "epoch 851,loss 14025.997070\n",
      "epoch 852,loss 14050.929688\n",
      "epoch 853,loss 13959.849609\n",
      "epoch 854,loss 13997.329102\n",
      "epoch 855,loss 14033.438477\n",
      "epoch 856,loss 14280.061523\n",
      "epoch 857,loss 13963.041016\n",
      "epoch 858,loss 14053.282227\n",
      "epoch 859,loss 13945.728516\n",
      "epoch 860,loss 13928.056641\n",
      "epoch 861,loss 14328.769531\n",
      "epoch 862,loss 14211.856445\n",
      "epoch 863,loss 13920.325195\n",
      "epoch 864,loss 14032.904297\n",
      "epoch 865,loss 14296.845703\n",
      "epoch 866,loss 13940.904297\n",
      "epoch 867,loss 14228.994141\n",
      "epoch 868,loss 13906.110352\n",
      "epoch 869,loss 13901.333008\n",
      "epoch 870,loss 14048.062500\n",
      "epoch 871,loss 13907.833008\n",
      "epoch 872,loss 13995.732422\n",
      "epoch 873,loss 13913.095703\n",
      "epoch 874,loss 13979.618164\n",
      "epoch 875,loss 13872.642578\n",
      "epoch 876,loss 14027.922852\n",
      "epoch 877,loss 13913.055664\n",
      "epoch 878,loss 13986.120117\n",
      "epoch 879,loss 14334.936523\n",
      "epoch 880,loss 14010.856445\n",
      "epoch 881,loss 13936.111328\n",
      "epoch 882,loss 13861.839844\n",
      "epoch 883,loss 13867.684570\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch 884,loss 13917.650391\n",
      "epoch 885,loss 13848.231445\n",
      "epoch 886,loss 13999.059570\n",
      "epoch 887,loss 14303.403320\n",
      "epoch 888,loss 13834.046875\n",
      "epoch 889,loss 13820.893555\n",
      "epoch 890,loss 13853.308594\n",
      "epoch 891,loss 13883.295898\n",
      "epoch 892,loss 14073.460938\n",
      "epoch 893,loss 13963.800781\n",
      "epoch 894,loss 13839.647461\n",
      "epoch 895,loss 13890.476562\n",
      "epoch 896,loss 13916.944336\n",
      "epoch 897,loss 13930.731445\n",
      "epoch 898,loss 13900.085938\n",
      "epoch 899,loss 13810.894531\n",
      "epoch 900,loss 14265.468750\n",
      "epoch 901,loss 13778.521484\n",
      "epoch 902,loss 13796.508789\n",
      "epoch 903,loss 13780.151367\n",
      "epoch 904,loss 13802.394531\n",
      "epoch 905,loss 13802.646484\n",
      "epoch 906,loss 13862.104492\n",
      "epoch 907,loss 14134.056641\n",
      "epoch 908,loss 13752.309570\n",
      "epoch 909,loss 13781.087891\n",
      "epoch 910,loss 13923.140625\n",
      "epoch 911,loss 13978.006836\n",
      "epoch 912,loss 13955.669922\n",
      "epoch 913,loss 14275.879883\n",
      "epoch 914,loss 13738.566406\n",
      "epoch 915,loss 13774.322266\n",
      "epoch 916,loss 13870.485352\n",
      "epoch 917,loss 14127.789062\n",
      "epoch 918,loss 13886.051758\n",
      "epoch 919,loss 13721.997070\n",
      "epoch 920,loss 13802.314453\n",
      "epoch 921,loss 13830.666016\n",
      "epoch 922,loss 14217.395508\n",
      "epoch 923,loss 14611.647461\n",
      "epoch 924,loss 13935.580078\n",
      "epoch 925,loss 13826.832031\n",
      "epoch 926,loss 13919.701172\n",
      "epoch 927,loss 13689.789062\n",
      "epoch 928,loss 14039.527344\n",
      "epoch 929,loss 13694.705078\n",
      "epoch 930,loss 13687.217773\n",
      "epoch 931,loss 13739.345703\n",
      "epoch 932,loss 13693.167969\n",
      "epoch 933,loss 13826.235352\n",
      "epoch 934,loss 13681.774414\n",
      "epoch 935,loss 13673.090820\n",
      "epoch 936,loss 13656.086914\n",
      "epoch 937,loss 13701.207031\n",
      "epoch 938,loss 13651.258789\n",
      "epoch 939,loss 13750.589844\n",
      "epoch 940,loss 13701.040039\n",
      "epoch 941,loss 13647.838867\n",
      "epoch 942,loss 13643.864258\n",
      "epoch 943,loss 13688.909180\n",
      "epoch 944,loss 13639.571289\n",
      "epoch 945,loss 13648.339844\n",
      "epoch 946,loss 13695.023438\n",
      "epoch 947,loss 14079.457031\n",
      "epoch 948,loss 13640.140625\n",
      "epoch 949,loss 13617.551758\n",
      "epoch 950,loss 14533.120117\n",
      "epoch 951,loss 13925.944336\n",
      "epoch 952,loss 13833.208984\n",
      "epoch 953,loss 13833.088867\n",
      "epoch 954,loss 13618.506836\n",
      "epoch 955,loss 14116.065430\n",
      "epoch 956,loss 13707.156250\n",
      "epoch 957,loss 13695.451172\n",
      "epoch 958,loss 13652.918945\n",
      "epoch 959,loss 13834.106445\n",
      "epoch 960,loss 13618.162109\n",
      "epoch 961,loss 13634.369141\n",
      "epoch 962,loss 13646.381836\n",
      "epoch 963,loss 13600.380859\n",
      "epoch 964,loss 13803.115234\n",
      "epoch 965,loss 13571.112305\n",
      "epoch 966,loss 13829.464844\n",
      "epoch 967,loss 13573.548828\n",
      "epoch 968,loss 14268.841797\n",
      "epoch 969,loss 13558.304688\n",
      "epoch 970,loss 13615.034180\n",
      "epoch 971,loss 13837.930664\n",
      "epoch 972,loss 13723.794922\n",
      "epoch 973,loss 13649.544922\n",
      "epoch 974,loss 13577.218750\n",
      "epoch 975,loss 13538.262695\n",
      "epoch 976,loss 14088.012695\n",
      "epoch 977,loss 13620.795898\n",
      "epoch 978,loss 13568.411133\n",
      "epoch 979,loss 13522.731445\n",
      "epoch 980,loss 13574.260742\n",
      "epoch 981,loss 14395.832031\n",
      "epoch 982,loss 13554.951172\n",
      "epoch 983,loss 13527.569336\n",
      "epoch 984,loss 13625.468750\n",
      "epoch 985,loss 13538.257812\n",
      "epoch 986,loss 13631.756836\n",
      "epoch 987,loss 13677.757812\n",
      "epoch 988,loss 13591.239258\n",
      "epoch 989,loss 13540.814453\n",
      "epoch 990,loss 13488.874023\n",
      "epoch 991,loss 13722.185547\n",
      "epoch 992,loss 13907.648438\n",
      "epoch 993,loss 13554.451172\n",
      "epoch 994,loss 13877.048828\n",
      "epoch 995,loss 13547.851562\n",
      "epoch 996,loss 14033.139648\n",
      "epoch 997,loss 13478.643555\n",
      "epoch 998,loss 13980.964844\n",
      "epoch 999,loss 13981.143555\n",
      "epoch 1000,loss 13504.351562\n"
     ]
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import d2lzh as d2l\n",
    "import xlrd\n",
    "import random\n",
    "import math\n",
    "from IPython import display\n",
    "from matplotlib import pyplot as plt\n",
    "from mxnet import autograd, nd\n",
    "batch_size = 10\n",
    "num_inputs = 4\n",
    "num_outputs = 1\n",
    "num_hiddens=200\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "w = nd.random.normal(scale=1, shape=(num_inputs, num_hiddens))\n",
    "b = nd.zeros(num_hiddens)\n",
    "w1=nd.random.normal(scale=1, shape=(num_hiddens, num_outputs))\n",
    "b1= nd.zeros(num_outputs)\n",
    "\n",
    "w.attach_grad()\n",
    "b.attach_grad()\n",
    "w1.attach_grad()\n",
    "b1.attach_grad()\n",
    "\n",
    "params=[w,b,w1,b1]\n",
    "print(w)\n",
    "def use_svg_display():\n",
    "    # 用矢量图显示\n",
    "    display.set_matplotlib_formats('svg')\n",
    "\n",
    "def set_figsize(figsize=(3.5, 2.5)):\n",
    "    use_svg_display()\n",
    "    # 设置图的尺寸\n",
    "    plt.rcParams['figure.figsize'] = figsize\n",
    "\n",
    "def squared_loss(y_hat, y):\n",
    "    return (y_hat - y) ** 2 / 2\n",
    "\n",
    "def relu(X):\n",
    "    return nd.maximum(X,0)\n",
    "\n",
    "def net(X):\n",
    "    H=relu(nd.dot(X,w)+b)\n",
    "    Y=nd.dot(H, w1) + b1\n",
    "    return Y\n",
    "\n",
    "def excel2matrix(path):\n",
    "    data = xlrd.open_workbook(path)\n",
    "    table = data.sheets()[0]\n",
    "    nrows = table.nrows  # 行数\n",
    "    ncols = table.ncols  # 列数\n",
    "    datamatrix = nd.random.normal(scale=1,shape=(nrows, ncols))\n",
    "    for i in range(nrows):\n",
    "        rows = table.row_values(i)\n",
    "        datamatrix[i,:] = rows\n",
    "    return datamatrix\n",
    " \n",
    "def data_iter(batch_size, features, labels):\n",
    "    num_examples = len(features)\n",
    "    indices = list(range(num_examples))\n",
    "    random.shuffle(indices)  # 样本的读取顺序是随机的\n",
    "    for i in range(0, num_examples, batch_size):\n",
    "        j = nd.array(indices[i: min(i + batch_size, num_examples)])\n",
    "        yield features.take(j), labels.take(j)  # take函数根据索引返回对应元素\n",
    "# def cross_entropy(y_hat, y):\n",
    "#     return -nd.pick(y_hat, y).log()\n",
    "# def accuracy(y_hat, y):\n",
    "#     return (y_hat.argmax(axis=1) == y.astype('float32')).mean().asscalar()\n",
    "\n",
    "# def evaluate_accuracy(data_iter, net):\n",
    "#     acc_sum, n = 0.0, 0\n",
    "#     for X, y in data_iter:\n",
    "#         y = y.astype('float32')\n",
    "#         acc_sum += (net(X).argmax(axis=1) == y).sum().asscalar()\n",
    "#         n += y.size\n",
    "#     return acc_sum / n\n",
    "\n",
    "num_epochs, lr = 1000, 0.00001\n",
    "\n",
    "def sgd(params, lr, batch_size):  \n",
    "    for param in params:\n",
    "        param[:] = param - lr * param.grad / batch_size\n",
    "\n",
    "def train_ch3(net, train_iter, test_iter, loss, num_epochs, batch_size,\n",
    "              params=None, lr=None):\n",
    "    for epoch in range(num_epochs):\n",
    "        for X, y in data_iter(batch_size,x,x_label):\n",
    "            with autograd.record():\n",
    "                y_hat = net(X)\n",
    "#                 print('X')\n",
    "#                 print(X)\n",
    "#                 print('y_hat')\n",
    "#                 print(y_hat)\n",
    "#                 print('y')\n",
    "#                 print(y)\n",
    "#                 print('[W,b]')\n",
    "#                 print([w,b])\n",
    "                l = loss(y_hat, y)\n",
    "            l.backward()   #求梯度\n",
    "            sgd(params, lr, batch_size)    #更新wb权重   \n",
    "#         print(params)\n",
    "        train_l_sum =loss(net(x),x_label)  #误差\n",
    "        print('epoch %d,loss %f' % (epoch + 1,train_l_sum.mean().asnumpy()))\n",
    "\n",
    "\n",
    "pathX = '标准化_309.xls'  #  113.xlsx 在当前文件夹下\n",
    "pathX2 = '标准化_309label.xls'  #  113.xlsx 在当前文件夹下\n",
    "pathX3 = '标准化_309pre.xls'  #  113.xlsx 在当前文件夹下\n",
    "x = excel2matrix(pathX)\n",
    "x_label=excel2matrix(pathX2)\n",
    "y_test=excel2matrix(pathX3)\n",
    "y_label=nd.zeros((y_test.shape[0],1))\n",
    "\n",
    "train_iter=data_iter(batch_size,x,x_label)\n",
    "test_iter=data_iter(batch_size,y_test,y_label)\n",
    "train_ch3(net, train_iter, test_iter, squared_loss, num_epochs, batch_size,params, lr)\n",
    "#set_figsize()\n",
    "#plt.scatter(x[:, 1].asnumpy(), x_label[:, 0].asnumpy(), 1);  # 加分号只显示图\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "e86025e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "[[ 1.33811605e+00 -4.34773445e+00  3.48940635e+00 -2.28485274e+00\n",
      "  -5.88322687e+00  1.70558321e+00 -1.21906511e-01  4.11259323e-01\n",
      "   9.28084671e-01 -4.21508372e-01  3.54979300e+00  5.67131090e+00\n",
      "  -6.87771559e-01  3.46716642e+00 -9.16602433e-01  3.66171837e+00\n",
      "  -8.47937226e-01  2.91082978e-01  1.03449953e+00 -1.35435390e+00\n",
      "  -3.64264560e+00  1.50820628e-01 -1.87109411e+00  1.23468995e+00\n",
      "  -6.38548672e-01  5.87812662e-01 -5.71726084e+00 -9.11389923e+00\n",
      "  -6.98229313e-01  2.71449506e-01 -1.65474617e+00 -6.17626143e+00\n",
      "  -1.29647779e+00  2.00839743e-01 -3.96329463e-01 -1.03723931e+00\n",
      "   2.15133414e-01 -3.68768144e+00  5.85010099e+00  8.70358720e-02\n",
      "  -6.73305392e-02 -4.94380891e-01 -6.60527349e-01  1.18975914e+00\n",
      "   2.54375625e+00  2.87200022e+00  1.15451932e+00 -6.45099461e-01\n",
      "  -1.49427128e+00 -7.18311262e+00 -1.82957351e+00 -1.14111292e+00\n",
      "  -9.67384148e+00 -1.08984756e+00 -9.76239800e-01 -1.24241388e+00\n",
      "  -4.33422893e-01  2.91543984e+00 -1.65142083e+00 -1.54216036e-01\n",
      "  -7.60933757e-02 -1.40568554e+00 -1.68793583e+00  5.93483627e-01\n",
      "  -3.11519432e+00 -1.50081635e+01 -8.05791283e+00 -6.68220997e-01\n",
      "   2.64192319e+00  1.72004151e+00 -1.10635543e+00 -8.57521534e-01\n",
      "   3.72122145e+00  7.37690210e-01  1.04046488e+00  1.84587848e+00\n",
      "  -7.05033541e-01  1.73181534e+00  2.53006935e+00  2.68141103e+00\n",
      "  -8.80513430e-01 -8.91637266e-01  9.00475919e-01 -5.37740529e-01\n",
      "   5.26650369e-01 -8.44671965e-01 -2.40923667e+00 -2.13965937e-01\n",
      "  -6.25626850e+00 -1.01204813e+00 -2.01294732e+00  2.83879328e+00\n",
      "  -1.05088151e+00  7.16117859e-01 -3.45621157e+00  1.82692349e+00\n",
      "   2.10434869e-01 -1.34549713e+00  2.59187436e+00  1.69915116e+00\n",
      "  -1.37117222e-01 -1.29285470e-01  1.17816269e+00  1.81197631e+00\n",
      "  -6.19897723e-01 -3.04264903e+00  1.10708845e+00 -4.28215384e-01\n",
      "  -2.13818479e+00 -9.08776343e-01  3.30119550e-01 -7.06864059e-01\n",
      "   1.75392270e-01  4.95242387e-01 -2.37240100e+00 -6.43553957e-02\n",
      "  -1.26729953e+00 -7.99237967e-01 -2.51357818e+00 -2.54986596e+00\n",
      "   2.46215916e+00  1.51440591e-01  1.40869391e+00  1.93122268e+00\n",
      "   3.54798293e+00 -3.99629682e-01 -1.16079912e+01  1.06297505e+00\n",
      "   2.05902353e-01 -2.05420470e+00  1.40677357e+00  2.39746737e+00\n",
      "  -7.47253120e-01 -1.67618394e+00 -1.40736127e+00  1.88429296e+00\n",
      "  -4.82173634e+00  4.67196047e-01 -8.45300734e-01 -5.81974328e-01\n",
      "   1.58193970e+00  3.23337734e-01 -2.24980783e+00 -1.33767056e+00\n",
      "   2.28614354e+00  4.30872869e+00 -3.08080173e+00  1.24355638e+00\n",
      "  -1.31406283e+00  1.12900853e-01  4.57507998e-01 -2.75310946e+00\n",
      "   7.25458682e-01  2.26044774e+00 -1.28797340e+00 -3.89581990e+00\n",
      "   1.59977400e+00  8.40087533e-01  3.04551411e+00  2.22326970e+00\n",
      "  -1.67425287e+00 -4.05768394e+00 -5.37731314e+00  8.97970498e-01\n",
      "  -7.21097589e-01 -6.01206481e-01  1.39879537e+00 -2.64143276e+00\n",
      "   5.83304279e-02  1.34147608e+00  1.36591002e-01  1.57968879e+00\n",
      "  -1.73975790e+00  2.89516002e-01  1.06902051e+00 -3.87240648e-01\n",
      "  -2.03098798e+00 -7.56546736e-01  1.79447758e+00 -9.27864969e-01\n",
      "   1.03479660e+00  1.09596872e+00  2.97054201e-01 -1.68692338e+00\n",
      "  -5.28380346e+00 -8.90960097e-01 -1.69008160e+00  2.91228712e-01\n",
      "   5.02838707e+00  7.24621892e-01  3.05926830e-01 -3.06447417e-01\n",
      "   8.85339856e-01  3.63107502e-01  2.39955974e+00 -1.26005983e+00\n",
      "  -7.79257596e-01 -1.88226271e+00 -2.37858796e+00  3.11590624e+00]\n",
      " [ 6.32971466e-01 -1.58284509e+00 -1.78433180e+00 -7.00260973e+00\n",
      "  -2.37088656e+00 -7.95078874e-01 -1.69142628e+00  7.26071358e+00\n",
      "   2.08701730e+00  2.87713468e-01 -1.73069179e+00 -3.17260051e+00\n",
      "  -1.46045327e+00 -2.02263451e+00 -2.22428298e+00  1.61406803e+01\n",
      "  -5.88763380e+00  1.00092947e-01  2.69168353e+00 -1.00787747e+00\n",
      "  -1.87383425e+00 -2.17714047e+00 -1.43391466e+00  7.60824633e+00\n",
      "  -6.40391648e-01  3.89100504e+00 -1.10720932e+00 -2.74475908e+00\n",
      "  -5.70478821e+00  1.14842154e-01 -6.99776411e+00 -3.01213765e+00\n",
      "   1.15995295e-01  9.87955189e+00  2.10098863e+00 -3.67175078e+00\n",
      "  -5.56730568e-01 -6.01922560e+00  6.35216618e+00 -1.21106541e+00\n",
      "  -1.45621216e+00 -1.21854067e+01 -1.08791471e+00 -6.97628081e-01\n",
      "  -3.21660757e+00 -1.27461612e+00 -4.06443691e+00 -5.24982643e+00\n",
      "  -3.72243261e+00 -2.15968442e+00  6.92988336e-01 -2.36966014e+00\n",
      "  -2.80348420e+00 -1.11019361e+00 -1.41748154e+00 -2.08328724e+00\n",
      "  -2.23208332e+00 -3.18811464e+00 -5.84445715e+00 -3.44199204e+00\n",
      "  -5.37591457e+00 -2.53926730e+00 -2.39111090e+00  7.19861841e+00\n",
      "  -2.22683001e+00 -1.06267977e+01 -6.66695547e+00 -5.79848099e+00\n",
      "   1.47832375e+01 -7.40603685e-01 -1.39984536e+00 -4.59657526e+00\n",
      "  -3.86608219e+00  2.89959145e+00  6.32669973e+00 -1.36798251e+00\n",
      "  -1.26514614e-01  3.25232029e+00  1.02007856e+01  1.33388290e+01\n",
      "  -1.41074193e+00  5.00391483e-01 -1.78093600e+00 -3.90537667e+00\n",
      "   6.70844460e+00 -1.47237670e+00 -3.28450370e+00 -1.24127996e+00\n",
      "  -1.22454059e+00 -1.76530790e+00 -3.03831530e+00 -1.42796886e+00\n",
      "  -3.56776762e+00 -6.03911448e+00 -6.18762636e+00  1.04282112e+01\n",
      "   6.64412022e-01  8.34721029e-02 -1.76917052e+00 -1.34854242e-01\n",
      "  -7.21124458e+00 -5.08863115e+00  7.96454096e+00 -5.90111494e-01\n",
      "   5.48033640e-02 -4.31632710e+00  1.08334684e+01 -1.03143921e+01\n",
      "  -1.38106024e+00 -4.35253143e+00 -3.52654886e+00 -3.80523992e+00\n",
      "   2.37577613e-02  2.32351199e-03 -3.94832706e+00 -1.36062533e-01\n",
      "  -1.66865003e+00 -1.26004183e+00 -4.30013371e+00 -3.23119330e+00\n",
      "  -1.23281264e+00 -2.37209415e+00 -1.10561001e+00 -8.41296971e-01\n",
      "  -1.63134551e+00 -1.21494818e+00 -1.09165258e+01 -1.99053729e+00\n",
      "   2.58254376e-03  5.98729610e-01 -2.72097015e+00 -1.35536110e+00\n",
      "  -4.49472046e+00  6.88768804e-01 -1.52971101e+00 -3.17798424e+00\n",
      "  -1.70315230e+00  2.13239336e+00 -1.73361766e+00 -1.87628901e+00\n",
      "   7.32368422e+00  4.93623495e-01 -9.48410332e-01  1.89453650e+00\n",
      "   7.58571088e-01 -4.72844362e+00 -6.58693933e+00 -6.07046485e-01\n",
      "  -4.10596037e+00 -9.50846374e-02  2.54568696e-01 -1.68396783e+00\n",
      "  -3.84072065e+00 -1.18033528e+00 -1.75400841e+00 -2.88736391e+00\n",
      "   1.41005564e+01 -5.15690851e+00 -1.77070963e+00  3.07647496e-01\n",
      "  -4.44274139e+00 -2.49364898e-01 -1.53302383e+00  2.76156038e-01\n",
      "  -6.85842752e+00 -1.11554360e+00 -9.36159909e-01 -2.43291998e+00\n",
      "  -2.82260084e+00  1.09850216e+01 -3.20650369e-01  6.75110281e-01\n",
      "  -3.10732174e+00 -2.74983382e+00 -1.80609155e+00 -6.98193121e+00\n",
      "  -2.82134628e+00 -7.24155998e+00  5.69092417e+00  2.39020085e+00\n",
      "  -8.02170694e-01 -8.97315860e-01 -3.42401445e-01 -2.40320063e+00\n",
      "  -4.18318748e+00 -4.07687378e+00 -9.77210641e-01 -8.32051086e+00\n",
      "  -2.88264227e+00  6.54388517e-02 -2.04314303e+00 -4.60385323e+00\n",
      "  -3.51917706e-02  3.09430742e+00  8.90897083e+00 -7.86969042e+00\n",
      "  -1.73781180e+00 -1.66159379e+00 -2.95096564e+00 -1.77639353e+00]\n",
      " [-2.45824432e+00  1.34729004e+00  1.69885933e+00 -4.12256145e+00\n",
      "   2.33498311e+00  1.27590823e+00  2.94876695e-01 -1.45243979e+00\n",
      "   1.30516195e+00 -4.61616844e-01  1.58464706e+00  3.09062767e+00\n",
      "   3.12293863e+00 -3.01341653e+00  2.78811765e+00 -3.52606869e+00\n",
      "  -3.27928376e+00 -1.83032072e+00  1.05902708e+00  1.52906311e+00\n",
      "   2.31098175e+00  3.99932194e+00  3.29464388e+00 -1.51550543e+00\n",
      "  -1.94241428e+00 -7.98464715e-01  1.01892376e+00  2.76360369e+00\n",
      "   1.54435003e+00  2.06178263e-01 -4.30783129e+00  1.65368986e+00\n",
      "  -1.33788514e+00  5.14631796e+00  9.61465895e-01  3.75399995e+00\n",
      "   8.24791864e-02  6.82574558e+00 -4.38550997e+00  2.15298676e+00\n",
      "   1.66695380e+00  2.70870948e+00  1.35383558e+00 -5.57275593e-01\n",
      "   2.03976202e+00  6.25570059e-01  2.63108301e+00 -3.10065055e+00\n",
      "   4.01899433e+00  1.93596923e+00 -6.41051769e-01  2.46217942e+00\n",
      "   2.85437441e+00  1.83520603e+00  1.62974536e+00  2.56800508e+00\n",
      "   1.14844489e+00  2.05187654e+00 -3.23886895e+00  9.77502227e-01\n",
      "   7.93780982e-01  3.73257518e+00  3.70699477e+00  3.74377084e+00\n",
      "   2.69539809e+00  5.37831545e+00  3.19002295e+00 -3.40803552e+00\n",
      "  -3.60970378e+00  1.19132066e+00 -1.39988160e+00  1.02716315e+00\n",
      "   2.80433035e+00  1.62633812e+00  2.81615281e+00  1.41817701e+00\n",
      "   4.33806837e-01  2.35957241e+00 -2.77686214e+00  7.39005089e+00\n",
      "   2.31969309e+00 -7.25331903e-01  6.66310072e-01  1.24519014e+00\n",
      "   3.29295278e+00  2.04158735e+00  3.90819097e+00  6.51199579e-01\n",
      "  -2.85904098e+00  4.01005507e+00  4.07445049e+00  1.16317415e+00\n",
      "   2.96330094e+00  1.29805362e+00  7.17380476e+00 -3.01757669e+00\n",
      "  -1.68324828e+00 -1.13266242e+00  1.93231475e+00  3.30535918e-01\n",
      "   2.27548385e+00  1.39424276e+00  4.22746706e+00  6.48101926e-01\n",
      "  -2.09828329e+00  5.31343699e+00  5.66200399e+00  1.20674193e+00\n",
      "   1.26953518e+00 -2.90308094e+00  8.92517149e-01  8.75669420e-01\n",
      "  -7.43958235e-01 -2.02826679e-01  4.57026196e+00  6.15470231e-01\n",
      "   2.17812729e+00  1.38363147e+00  4.60092068e+00  3.16588664e+00\n",
      "   5.03567100e-01  9.56365943e-01  1.26617074e+00  1.06876552e+00\n",
      "   9.83650923e-01  1.46566248e+00  6.13774443e+00  1.17102027e+00\n",
      "  -5.65504432e-02 -2.02096730e-01  7.23091662e-01  2.03006458e+00\n",
      "   6.26039147e-01 -1.02017963e+00  1.69184458e+00  2.54562998e+00\n",
      "  -2.82379532e+00  7.40204930e-01  2.70762682e+00  1.37034070e+00\n",
      "   4.17815924e+00 -1.00582588e+00  1.27015734e+00 -1.76491880e+00\n",
      "  -1.08320594e+00  3.24126220e+00  7.08250427e+00  2.24847257e-01\n",
      "  -2.63122511e+00 -3.57226998e-01 -4.92048591e-01  2.55364823e+00\n",
      "   1.09621298e+00  1.11128235e+00 -2.18166169e-02  2.77872634e+00\n",
      "  -3.66707182e+00  5.61313772e+00 -2.87708545e+00 -7.36334026e-01\n",
      "   9.20125067e-01 -2.32784748e+00 -2.98098135e+00 -7.47124493e-01\n",
      "  -3.85916758e+00  2.43634367e+00 -1.24835813e+00  2.92846394e+00\n",
      "   2.93641329e+00 -2.92601871e+00  5.92646062e-01 -8.49151373e-01\n",
      "   4.80673504e+00  2.02114999e-01  1.58182430e+00  1.85056484e+00\n",
      "   4.48350668e+00  9.27627325e-01  3.53854012e+00 -5.80657423e-01\n",
      "   1.24446774e+00  6.89126551e-01 -4.85218108e-01 -2.80264944e-01\n",
      "   2.39449692e+00  6.13328040e-01  1.41829908e+00  1.84584987e+00\n",
      "   2.79746699e+00 -2.11385131e+00  3.16689104e-01  8.40871572e-01\n",
      "   8.41515884e-02  1.50862074e+00  5.20930767e+00 -4.54543877e+00\n",
      "  -1.55014837e+00  2.10264659e+00  5.24872732e+00  2.07773376e+00]\n",
      " [ 1.16279280e+00  4.33384228e+00 -2.02890253e+00 -6.08195364e-01\n",
      "   6.62972975e+00 -1.16251075e+00 -2.94858456e-01 -8.44347119e-01\n",
      "   6.80742085e-01  1.20838523e+00 -2.98904276e+00 -5.06611490e+00\n",
      "   1.12793624e+00 -3.33603954e+00  9.45169449e-01  1.10949767e+00\n",
      "   5.35274744e-01 -5.48615277e-01  9.03311223e-02 -4.50521439e-01\n",
      "   1.81872046e+00  1.98380101e+00  2.84781575e-01  1.54902795e-02\n",
      "   3.18272300e-02 -8.40311125e-02  2.45923448e+00  7.16580772e+00\n",
      "  -1.72446024e+00 -2.60972887e-01 -1.34101068e-03  4.91545057e+00\n",
      "  -1.57197428e+00  1.06384993e-01 -4.37611043e-01  2.18673325e+00\n",
      "  -1.93627799e+00  1.32513106e+00 -2.38062787e+00  1.56087172e+00\n",
      "   1.53002071e+00 -2.15122938e+00  1.38486183e+00  9.36416566e-01\n",
      "  -3.48512125e+00 -1.48619497e+00 -1.35993123e+00  5.79642594e-01\n",
      "   1.49770927e+00  5.63814259e+00  2.32123435e-01  1.11884212e+00\n",
      "   7.24302387e+00 -2.11889297e-01  1.03566229e+00  2.33887315e+00\n",
      "  -6.80639684e-01 -2.79761243e+00 -2.58705437e-01 -7.81048477e-01\n",
      "  -8.44511330e-01  2.02541813e-01  1.19986880e+00 -2.66767532e-01\n",
      "   9.68918763e-03  1.05662184e+01  8.33500195e+00  7.37102449e-01\n",
      "   3.59147370e-01 -6.12393916e-01 -2.38710195e-01 -1.67372859e+00\n",
      "  -3.13861322e+00  7.27656960e-01  3.10138792e-01 -3.70672727e+00\n",
      "  -6.10602021e-01  1.35020244e+00  7.81200349e-01  1.15123975e+00\n",
      "   5.10708928e-01 -6.68945730e-01  6.95472240e-01 -1.15940845e+00\n",
      "  -2.65682369e-01  5.93726039e-01  1.99465156e+00 -4.32029456e-01\n",
      "   4.40041351e+00  1.40584552e+00  1.07917035e+00 -1.52967024e+00\n",
      "   2.98626637e+00  1.56428754e-01  2.17818332e+00  1.07202303e+00\n",
      "  -6.78939402e-01 -1.75795650e+00 -4.30665541e+00 -1.57296455e+00\n",
      "  -1.12114298e+00 -1.03552341e+00  2.56283462e-01  7.56109834e-01\n",
      "  -4.55685794e-01  1.37959087e+00  1.03392208e+00 -2.13009477e+00\n",
      "   1.02052653e+00  2.73547292e-01 -2.67955720e-01 -1.33115721e+00\n",
      "  -7.49034822e-01  3.37679386e-01  1.94124866e+00  7.46907115e-01\n",
      "   7.91824043e-01  9.16701078e-01  1.33549654e+00  1.86109424e+00\n",
      "  -2.17497897e+00 -2.38883346e-01 -3.19811201e+00 -7.62726068e-01\n",
      "  -9.69983637e-01  8.71734977e-01  9.65752506e+00 -2.79543257e+00\n",
      "  -2.08106920e-01 -1.31276584e+00  1.12274301e+00 -3.51795721e+00\n",
      "  -1.25561178e+00  7.31761158e-01 -1.87538281e-01 -4.34998274e+00\n",
      "   6.47232628e+00  2.14317158e-01  7.42353737e-01  2.69562888e+00\n",
      "   1.56329906e+00 -1.13184655e+00  2.68431997e+00  5.53359389e-01\n",
      "  -2.24291110e+00 -4.24820995e+00  2.43172431e+00 -4.71981198e-01\n",
      "  -3.41264635e-01  6.74922392e-02 -1.44615024e-01  8.93244624e-01\n",
      "   1.55318752e-01 -2.37393999e+00 -1.29845130e+00  2.64715767e+00\n",
      "   5.59118986e-01 -1.70465577e+00 -2.90997124e+00 -5.51686049e-01\n",
      "  -2.58833098e+00  1.85884845e+00  5.67389870e+00 -4.06941831e-01\n",
      "   8.89496624e-01  7.89157808e-01  5.62027156e-01  8.62642765e-01\n",
      "   2.11305118e+00  5.37390530e-01 -2.00139689e+00 -2.08757949e+00\n",
      "   1.99448431e+00 -8.14897716e-02 -2.55011368e+00 -1.63079333e+00\n",
      "   1.51275182e+00 -1.84565401e+00  1.06812632e+00  1.55038285e+00\n",
      "  -2.31694865e+00 -2.73487020e+00 -3.26882340e-02 -1.87631571e+00\n",
      "   4.21036720e+00 -1.69722855e+00 -2.61152893e-01 -9.26577389e-01\n",
      "  -4.85422087e+00  3.33230019e-01 -8.12897503e-01 -1.14369309e+00\n",
      "  -1.23600650e+00  3.43696982e-01  2.33231568e+00  5.82322955e-01\n",
      "   8.30578983e-01 -1.24544300e-01  1.26570725e+00 -3.06365395e+00]]\n",
      "<NDArray 4x200 @cpu(0)>, \n",
      "[ 0.          1.8837574   1.2257329  -3.3051434   2.3142536   0.0571001\n",
      "  0.27913094 -1.3261344   1.0910733  -0.23840225  1.441588    2.5976048\n",
      "  1.8158228  -2.346706    1.4359177  -3.4227147  -2.7150967   0.\n",
      "  2.010395    1.2536      1.7552818   0.5015225   2.5839152  -1.6720585\n",
      " -0.0516332  -0.7231061   2.0536745   3.3082857   0.80015266 -0.67440677\n",
      " -2.974689    1.0755296   0.          5.185748    1.1240678   3.2370925\n",
      "  0.47590518  5.166936   -5.03486     1.999163    0.7776989   1.7871836\n",
      "  0.5819432  -0.19792025  2.7903311   1.404777    3.3860009  -2.2246234\n",
      "  4.131455    2.8453567  -0.27488655  2.2585309   3.462565    0.5782685\n",
      "  1.0762792   2.2671316  -0.36683008  2.5506458  -2.9011405   0.43675494\n",
      "  1.2202426   1.3554418   3.1833527   3.8626072   2.28461     7.2721515\n",
      "  4.0237947  -2.417176   -2.7630382  -0.11101159 -0.29930586  0.8604263\n",
      "  2.6995401   1.5784775   4.0013533   1.504905    0.13028823  1.4463289\n",
      " -1.2931767   7.1047573   1.148372   -0.15532453 -0.06875551  0.28862444\n",
      "  3.7894332   2.0922813   2.48056    -0.14407574 -1.5361421   2.748291\n",
      "  3.5862277   1.170056    1.669081    0.6679517   4.901913   -2.8995535\n",
      "  0.          0.          1.7235326  -0.12816167  0.38483793  0.6752529\n",
      "  4.32027    -0.13236918  0.          4.5699425   5.8924375   2.8708463\n",
      "  1.6879896  -1.4653955   0.50277615  0.6390666   0.          0.\n",
      "  3.5573187   0.92847687  2.559688    1.5802228   3.8585913   3.171093\n",
      "  1.6293663  -0.02625323  1.1366231   0.18197829  1.4180939   0.74269027\n",
      "  7.0916495   1.9454212  -0.26732707 -0.14931893  0.16263227  0.70026684\n",
      "  0.95438826 -0.02782199  1.5815212   2.493713   -1.7742815   1.5864121\n",
      "  0.61401385  1.7747809   3.844623   -0.30725032  0.55359954 -0.3877133\n",
      " -0.4441468   3.6009722   5.59972     0.7178464  -1.7280296   0.\n",
      " -0.13527395  1.9049283   0.34085283  1.0227193   0.6531642   3.0531847\n",
      " -4.2182994   4.2457643  -1.8221326  -0.2755602   1.0397047  -0.7378922\n",
      " -1.5470729  -0.43689653 -3.0550547   2.0500906  -0.25447565  2.9494271\n",
      "  2.110375   -3.2304006   0.37381512 -0.38278684  4.3796186   0.7986651\n",
      "  1.2966324   0.9950318   4.230015    1.8508145   2.8071167  -2.1165178\n",
      "  0.47851056  1.3376272  -0.1408398   1.086672    2.5676222   1.1384395\n",
      "  2.0585592   1.2853535   2.4097142   0.          1.919267    1.0522709\n",
      "  0.04211334  1.8040099   4.669526   -3.506631   -0.8933189   1.5250285\n",
      "  3.7029822   1.1868863 ]\n",
      "<NDArray 200 @cpu(0)>]\n"
     ]
    }
   ],
   "source": [
    "print([w,b])\n",
    "pathX4 = '标准化_272pre.xls'  #  113.xlsx 在当前文件夹下\n",
    "y_test1=excel2matrix(pathX4)\n",
    "a=net(y_test1)\n",
    "\n",
    "set_figsize()\n",
    "#plt.scatter(x[:, 1].asnumpy(), x_label[:, 0].asnumpy(), 1);  # 加分号只显示图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "77210598",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-338.26605]\n",
      " [-338.70782]\n",
      " [-338.70782]\n",
      " ...\n",
      " [ 822.2815 ]\n",
      " [ 822.2815 ]\n",
      " [ 822.28156]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "a1=a.asnumpy()\n",
    "print(a1)\n",
    "np.savetxt(\"./result.txt\",a1,fmt='%d')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c52cd1fa",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:gluon] *",
   "language": "python",
   "name": "conda-env-gluon-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
